#include "exception.h"
#include "ft_types.h"
#include "ft_assert.h"
#include <stdio.h>

_WEAK void SerrHandle(exception_frame *exc)
{
    FT_ASSERTVOID(0);
    (void)exc;
    while (1)
    {
    }
}

_WEAK void IrqHandleException(void *value)
{
    FT_ASSERTVOID(0);
    (void)value;
    while (1)
    {
    }
}

void CommonTrapHandler(exception_frame *exc)
{
    if ((exc->exc_type & 0xff) == AARCH64_EXC_SYNC_SPX)
    {
        SerrHandle(exc);
    }

    if ((exc->exc_type & 0xff) == AARCH64_EXC_IRQ_SPX)
    {
        IrqHandleException(exc);
    }

    return;
}
